#include <iostream>

using namespace std;

typedef struct TestStruct
{
    char 	A;
    int 	B;
    char	C;
    char	D;
}TestStruct_t;

int main()
{
    TestStruct_t onStack;
    
    TestStruct_t* onHeap = new TestStruct();
    
    cout << "&onStack " << (unsigned int)&onStack << endl;
    cout << "&onStack.A (char) " << (unsigned int)&onStack.A << endl;
    cout << "&onStack.B (int )" << (unsigned int)&onStack.B << endl;
    cout << "&onStack.C (char)" << (unsigned int)&onStack.C << endl;
    cout << "&onStack.D (char)" << (unsigned int)&onStack.D << endl;
    cout << "sizeof(onStack) " << sizeof(onStack) << endl;
    
    cout << "&onHeap " << (unsigned int)onHeap << endl;
    cout << "&onHeap.A (char) " << (unsigned int)(&onHeap->A) << endl;
    cout << "&onHeap.B (int )" << (unsigned int)(&onHeap->B) << endl;
    cout << "&onHeap.C (char)" << (unsigned int)(&onHeap->C) << endl;
    cout << "&onHeap.D (char)" << (unsigned int)(&onHeap->D) << endl;
    cout << "sizeof(*onHeap) " << sizeof(*onHeap) << endl;
    

    char* p = new char[1];
    cout << "&p " << &p << endl;
    
    return 0;
    

}

